#ifndef EFFECT_MODEL_MANAGER_H_
#define EFFECT_MODEL_MANAGER_H_

#include "Common.h"
#include "Resource.h"
#include "ResourceManager.h"
#include "Singleton.h"
#include "String.h"

class  EffectModelManager: public ResourceManager,public Singleton<EffectModelManager>
{
public:
	EffectModelManager();
	~EffectModelManager();

	String	getEffectModelStringName(const uint32 & serial);
	
	ResourcePtr  create(const uint32 & serial,const NameValuePairList* params = 0);
	ResourceCreateOrRetrieveResult  \
		createOrRetrieve(const uint32 & serial,const NameValuePairList* params = 0);
	ResourcePtr  load(const uint32 & serial);

	//user manager start
	void	Startup(const uint32 & group_id);
	void 	Shutdown(void);

	//根据查询，返回符合条件的记录 offset 为翻页起点 limitcount 为取回最大数量 query 为查询条件在 WHERE之后
	bool	getEffectModelsList(std::list<ResourcePtr> * effectmodels,const uint32 & offset,const uint32 & limitcount,const char * query,...);

	//根据查询条件返回一个查询结果数量 query 为在WHERE之后的SQL语句
	uint32	getDBCount(const char * query,...);


protected:
	uint32		m_group_id;
	String		m_group_name;
       /// @copydoc ResourceManager::createImpl
        Resource* createImpl(const String& name, ResourceHandle handle,
            const String& group, bool isManual, ManualResourceLoader* loader,
            const NameValuePairList* createParams);
};



#define   sEffectModelMgr	   EffectModelManager::getSingleton()

#endif 
